package com.snail.activity;

import android.app.Activity;
import android.os.Bundle;
import android.view.Menu;
import android.view.View;
import android.view.View.OnClickListener;
import android.widget.Button;
import android.widget.EditText;
import android.widget.TextView;

import com.snail.config.ConfigExtraString;

@SuppressWarnings("unused")
public class ActivityLoginInstance extends ActivityBase implements OnClickListener {

	//登陆类型
	private int login_type = -1;
	
	//登陆实体界面第一个输入框左侧的提示
    private TextView loginFirstHint;
    
	private EditText loginFirstEdit;
    
    //登陆实体界面第二个输入框左侧的提示
    private TextView loginSecondHint;
    private EditText loginSecondEdit;
    
    //登陆按钮
    private Button 	 loginLeftButton;
    
    //注册按钮
    private Button 	 loginRightButton;
    
    @Override
    public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_login_instance);
        
        loginFirstHint = (TextView)findViewById(R.id.login_first_hint);
        loginFirstEdit = (EditText)findViewById(R.id.login_first_edit);
        loginSecondHint = (TextView)findViewById(R.id.login_second_hint);
        loginSecondEdit = (EditText)findViewById(R.id.login_second_edit);
        loginLeftButton = (Button)findViewById(R.id.login_left_button);
        loginLeftButton.setOnClickListener(this);
        loginRightButton = (Button)findViewById(R.id.login_right_button);
        loginRightButton.setOnClickListener(this);
        
        login_type = getIntent().getIntExtra(ConfigExtraString.LOGIN_TYPE_NAME, -1);
        
        switch(login_type) {
        case 1:
        	loginFirstHint.setText(R.string.login_instance_phone_number);
        	break;
        	
        case 2:
        	loginFirstHint.setText(R.string.login_instance_qq);
        	break;
        	
        case 3:
        	loginFirstHint.setText(R.string.login_instance_weibo);
        	break;
        default:
        	break;
        }
    }

    @Override
    public boolean onCreateOptionsMenu(Menu menu) {
        getMenuInflater().inflate(R.menu.activity_login_instance, menu);
        return true;
    }

	@Override
	public void onClick(View v) {
		int id = v.getId();
		
		switch(id) {
		case R.id.login_left_button:
			//调用登陆接口进行登陆，登陆完成后进入游戏大厅
			break;
		case R.id.login_right_button:
			//进入注册界面进行注册，注册完成后返回到登陆界面
			break;
		default:
			break;
		}
	}
}
